/*     */ package com.lmpop.trade.ti_goods_ship;
/*     */ 
/*     */ import com.lmpop.frame.QueryList;
/*     */ import com.lmpop.frame.SysMap;
/*     */ import com.lmpop.frame.TradeInterf;
/*     */ import com.lmpop.frame.dao.DbmInterf;
/*     */ import com.lmpop.frame.exp.ApplicationException;
/*     */ import java.util.Hashtable;
/*     */ import java.util.List;
/*     */ 
/*     */ public class Ti_goods_shipInfo
/*     */   implements TradeInterf
/*     */ {
/*     */   QueryList queryList;
/*     */ 
/*     */   public Ti_goods_shipInfo()
/*     */   {
/*  16 */     this.queryList = new QueryList();
/*     */   }
/*     */ 
/*     */   public SysMap insert(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  25 */     Ti_goods_ship ti_goods_ship = new Ti_goods_ship();
/*     */ 
/*  27 */     ti_goods_ship.setGoods_id(map.getString("goods_id"));
/*  28 */     ti_goods_ship.setCust_id(map.getString("cust_id"));
/*  29 */     ti_goods_ship.setArea_attr(map.getString("area_attr"));
/*  30 */     ti_goods_ship.setShip_name(map.getString("ship_name"));
/*  31 */     ti_goods_ship.setShip_price(map.getString("ship_price"));
/*  32 */     ti_goods_ship.setArea_price_add(map.getString("area_price_add"));
/*  33 */     ti_goods_ship.setNum_price_add(map.getString("num_price_add"));
/*  34 */     ti_goods_ship.setMember_price(map.getString("member_price"));
/*  35 */     ti_goods_ship.setRsrv_str1(map.getString("rsrv_str1"));
/*  36 */     ti_goods_ship.setRsrv_str2(map.getString("rsrv_str2"));
/*  37 */     ti_goods_ship.setRsrv_str3(map.getString("rsrv_str3"));
/*  38 */     ti_goods_ship.setRsrv_str4(map.getString("rsrv_str4"));
/*  39 */     ti_goods_ship.setRsrv_str5(map.getString("rsrv_str5"));
/*  40 */     ti_goods_ship.setRsrv_str6(map.getString("rsrv_str6"));
/*  41 */     ti_goods_ship.setRsrv_str7(map.getString("rsrv_str7"));
/*  42 */     ti_goods_ship.setRsrv_str8(map.getString("rsrv_str8"));
/*  43 */     ti_goods_ship.setPublish_user_id(map.getString("publish_user_id"));
/*     */ 
/*  45 */     String result_code = "0";
/*     */     try {
/*  47 */       insert(dbmMgr, ti_goods_ship);
/*     */     } catch (ApplicationException e) {
/*  49 */       e.printStackTrace();
/*  50 */       result_code = "1";
/*     */     }
/*  52 */     map.setString("result_code", result_code);
/*  53 */     return map;
/*     */   }
/*     */ 
/*     */   public void insert(DbmInterf dbmMgr, Ti_goods_ship ti_goods_ship)
/*     */     throws ApplicationException
/*     */   {
/*  62 */     dbmMgr.update("insertTi_goods_ship", ti_goods_ship);
/*     */   }
/*     */ 
/*     */   public SysMap delete(DbmInterf dbmMgr, SysMap map)
/*     */   {
/*  72 */     String pkid_string = map.getString("pkid");
/*  73 */     Ti_goods_ship ti_goods_ship = new Ti_goods_ship();
/*     */ 
/*  75 */     ti_goods_ship.setGoods_id(map.getString("goods_id"));
/*  76 */     ti_goods_ship.setCust_id(map.getString("cust_id"));
/*     */ 
/*  78 */     String result_code = "0";
/*     */     try {
/*  80 */       if (!pkid_string.equals("")) {
/*  81 */         String[] pkStr = pkid_string.split("\\|");
/*  82 */         for (int i = 0; i < pkStr.length; i++) {
/*  83 */           if (pkStr[i].equals(""))
/*     */             continue;
/*  85 */           ti_goods_ship.setArea_attr(pkStr[i]);
/*  86 */           delete(dbmMgr, ti_goods_ship);
/*     */         }
/*     */       }
/*     */     }
/*     */     catch (ApplicationException e) {
/*  91 */       e.printStackTrace();
/*  92 */       result_code = "1";
/*     */     }
/*  94 */     map.setString("result_code", result_code);
/*  95 */     return map;
/*     */   }
/*     */ 
/*     */   public void delete(DbmInterf dbmMgr, Ti_goods_ship ti_goods_ship)
/*     */     throws ApplicationException
/*     */   {
/* 104 */     dbmMgr.update("deleteTi_goods_ship", ti_goods_ship);
/*     */   }
/*     */ 
/*     */   public SysMap update(DbmInterf dbmMgr, SysMap map)
/*     */   {
/* 113 */     Ti_goods_ship ti_goods_ship = new Ti_goods_ship();
/*     */ 
/* 115 */     ti_goods_ship.setGoods_id(map.getString("goods_id"));
/* 116 */     ti_goods_ship.setCust_id(map.getString("cust_id"));
/* 117 */     ti_goods_ship.setArea_attr(map.getString("area_attr"));
/* 118 */     ti_goods_ship.setShip_name(map.getString("ship_name"));
/* 119 */     ti_goods_ship.setShip_price(map.getString("ship_price"));
/* 120 */     ti_goods_ship.setArea_price_add(map.getString("area_price_add"));
/* 121 */     ti_goods_ship.setNum_price_add(map.getString("num_price_add"));
/* 122 */     ti_goods_ship.setMember_price(map.getString("member_price"));
/* 123 */     ti_goods_ship.setRsrv_str1(map.getString("rsrv_str1"));
/* 124 */     ti_goods_ship.setRsrv_str2(map.getString("rsrv_str2"));
/* 125 */     ti_goods_ship.setRsrv_str3(map.getString("rsrv_str3"));
/* 126 */     ti_goods_ship.setRsrv_str4(map.getString("rsrv_str4"));
/* 127 */     ti_goods_ship.setRsrv_str5(map.getString("rsrv_str5"));
/* 128 */     ti_goods_ship.setRsrv_str6(map.getString("rsrv_str6"));
/* 129 */     ti_goods_ship.setRsrv_str7(map.getString("rsrv_str7"));
/* 130 */     ti_goods_ship.setRsrv_str8(map.getString("rsrv_str8"));
/* 131 */     ti_goods_ship.setPublish_user_id(map.getString("publish_user_id"));
/*     */ 
/* 133 */     String result_code = "0";
/*     */     try {
/* 135 */       update(dbmMgr, ti_goods_ship);
/*     */     } catch (ApplicationException e) {
/* 137 */       e.printStackTrace();
/* 138 */       result_code = "1";
/*     */     }
/* 140 */     map.setString("result_code", result_code);
/* 141 */     return map;
/*     */   }
/*     */ 
/*     */   public void update(DbmInterf dbmMgr, Ti_goods_ship ti_goods_ship)
/*     */     throws ApplicationException
/*     */   {
/* 150 */     dbmMgr.update("updateTi_goods_ship", ti_goods_ship);
/*     */   }
/*     */ 
/*     */   public List getListByPage(Object obj, int start, int limit)
/*     */   {
/* 160 */     Hashtable ti_goods_ship = (Hashtable)obj;
/*     */ 
/* 162 */     if (start == 0)
/* 163 */       start = 0;
/*     */     else {
/* 165 */       start = (start - 1) * limit;
/*     */     }
/* 167 */     ti_goods_ship.put("start", Integer.valueOf(start));
/* 168 */     ti_goods_ship.put("limit", Integer.valueOf(limit));
/*     */ 
/* 170 */     return this.queryList.getList("getListByTi_goods_shipPage", ti_goods_ship);
/*     */   }
/*     */ 
/*     */   public int getCountByObj(Object obj)
/*     */   {
/* 181 */     Hashtable ti_goods_ship = (Hashtable)obj;
/* 182 */     List list = this.queryList.getList("getCountByObjTi_goods_ship", ti_goods_ship);
/* 183 */     int count = 0;
/* 184 */     if ((list != null) && (list.size() > 0)) {
/* 185 */       Hashtable newsMap = (Hashtable)list.get(0);
/* 186 */       if ((newsMap.get("count") != null) && (!newsMap.get("count").toString().equals(""))) {
/* 187 */         count = Integer.parseInt(newsMap.get("count").toString());
/*     */       }
/*     */     }
/* 190 */     return count;
/*     */   }
/*     */ 
/*     */   public List getListByPk(String pk)
/*     */   {
/* 201 */     return this.queryList.getList("getTi_goods_shipByPk", pk);
/*     */   }
/*     */   public List getListByArea(Ti_goods_ship ti_goods_ship) {
/* 204 */     return this.queryList.getList("getTi_goods_shipByArea", ti_goods_ship);
/*     */   }
/*     */   public List getListByGoods(Ti_goods_ship ti_goods_ship) {
/* 207 */     return this.queryList.getList("getTi_goods_shipByGoods", ti_goods_ship);
/*     */   }
/*     */ 
/*     */   public SysMap UpdateAreas(DbmInterf dbmMgr, SysMap map) {
/* 211 */     Ti_goods_ship ti_goods_ship = new Ti_goods_ship();
/* 212 */     ti_goods_ship.setGoods_id(map.getString("goods_id"));
/* 213 */     ti_goods_ship.setCust_id(map.getString("cust_id"));
/*     */ 
/* 217 */     ti_goods_ship.setArea_price_add("0");
/* 218 */     ti_goods_ship.setNum_price_add("0");
/* 219 */     ti_goods_ship.setMember_price("0");
/* 220 */     String pkid_string = map.getString("sort");
/* 221 */     String result_code = "0";
/*     */     try {
/* 223 */       if (!pkid_string.equals("")) {
/* 224 */         String[] pkStr = pkid_string.split("\\|");
/* 225 */         for (int i = 0; i < pkStr.length; i++)
/*     */         {
/* 227 */           if (pkStr[i].equals(""))
/*     */             continue;
/* 229 */           String[] sort = pkStr[i].split(",");
/*     */ 
/* 231 */           if (sort.length != 2) {
/*     */             continue;
/*     */           }
/* 234 */           ti_goods_ship.setArea_attr(sort[0]);
/* 235 */           ti_goods_ship.setShip_price(sort[1]);
/* 236 */           update(dbmMgr, ti_goods_ship);
/*     */         }
/*     */       }
/*     */     }
/*     */     catch (ApplicationException e)
/*     */     {
/* 242 */       e.printStackTrace();
/* 243 */       result_code = "1";
/*     */     }
/* 245 */     map.setString("result_code", result_code);
/* 246 */     return map;
/*     */   }
/*     */ }

/* Location:           F:\电商\commons-utils.jar
 * Qualified Name:     com.lmpop.trade.ti_goods_ship.Ti_goods_shipInfo
 * JD-Core Version:    0.6.0
 */